#include <iostream>
#include <vector>
using namespace std;

class Solution {
	vector<vector<int>> gh;
	vector<long long> size, cost;
	void mini_cost(int u, int p, int seats)
	{
		size[u] = 1;
		for (auto v : gh[u]) {
			if (v != p) {
				mini_cost(v, u, seats);
                                size[u] += size[v];
                                cost[u] += cost[v];
                                cost[u] += (size[v] + seats - 1)/seats;
			}
		}
	}

    public:
	long long minimumFuelCost(vector<vector<int>> &roads, int seats)
	{
		int n = roads.size() + 1;
		gh.resize(n);
		size.resize(n, 0);
		cost.resize(n, 0);
		for (int i = 0; i < roads.size(); i++) {
			int u = roads[i][0], v = roads[i][1];
			gh[u].push_back(v);
			gh[v].push_back(u);
		}

		mini_cost(0, -1, seats);
                return cost[0];
	}
};

int main()
{
	vector<vector<int>> roads = { { 0, 1 }, { 0, 2 }, { 0, 3 } };
	int seats = 5;
	cout << Solution().minimumFuelCost(roads, seats) << endl;
	return 0;
}